#!/usr/bin/env bash

set -e -u -x
source ./tasks/helpers.sh

glauth_version="2.3.2"
glauth_hash="effd05253d04b97469a18cbe83ff9847fb762f49013b63cb1771d916d44ec0f6"
if [ "$TARGETARCH" == "arm64" ]; then
  glauth_hash="ab4870615922c098c096f0a002853f0017d3a35f413b1318bcb902a36dddeae9"
fi

task_working_dir
download "https://github.com/glauth/glauth/releases/download/v$glauth_version/glauth-linux-${TARGETARCH}" "sha256" "$glauth_hash"

install -D -m 755 "_persist/downloads/glauth-linux-${TARGETARCH}" "$TEST_INSTALL_PREFIX/bin/glauth"

stamp
